<?php

/**
 * Description of IndexController
 *
 * @author Mon Zafra <monzee@gmail.com>
 * @license default
 */
class IndexController extends Zend_Controller_Action
{
    public function indexAction()
    {
        $this->_helper->viewRenderer->setNoRender(true);
        echo '<h1>Hello world!</h1>';
        echo '<a href="' . $this->_helper->url('index', 'test') . '">Controller with no template</a><br />';
        echo '<a href="' . $this->_helper->url('tpltest', 'test') . '">Controller with template</a>';
    }

    public function formAction()
    {
        $form = new Zend_Form();
        $form->addElement('text', 'username', array('label' => 'Username', 'required' => true))
    	     ->addElement('password', 'password', array('label' => 'Password', 'required' => true))
    	     ->addElement('submit', 'submit', array('label' => 'Login'))
             ->addDecorator('FormErrors');
        if ($this->_request->isPost()) {
            $form->isValid($this->_request->getPost());
        }
        $this->view->form = $form;
    }

}
